﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views {
    import flash.events.*;
    import org.robotlegs.core.*;
    import net.wooga.pets.events.*;
    import net.wooga.pets.models.world.vos.actors.*;
    import net.wooga.pets.views.world.*;

    public class AvatarMediator extends AbstractActorMediator implements IMediator {

        override public function onRegister():void{
            super.onRegister();
            if (userModel.isVisitFriendsMode()){
                this.view.hide();
            };
        }
        override protected function onMouseOut(_arg1:MouseEvent):void{
        }
        override protected function onMouseOver(_arg1:MouseEvent):void{
        }
        private function get view():AvatarView{
            return ((viewComponent as AvatarView));
        }
        private function get vo():AvatarVO{
            return ((_vo as AvatarVO));
        }
        override protected function setPosition(_arg1:Number, _arg2:Number):void{
            this.view.direction = ((_arg1)>=this.view.x) ? -1 : 1;
            super.setPosition(_arg1, _arg2);
        }
        override protected function toggleFacade(_arg1:BuildingEvent=null):void{
            if (!this.view){
                return;
            };
            this.view.visible = !(gameStateModel.isFacadeVisible);
        }

    }
}//package net.wooga.pets.views 
